package com.unitd.frame.sso.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @desc SSO配置信息启动监听类, 用于初始化SSO配置信息
 * @filename SSOConfigListener.java
 * @copyright www.unitd.com
 * @author Hudan
 * @version 1.0
 * @date 2016/10/14
 */
public class SSOConfigListener implements ServletContextListener {

	private static final Logger logger = LoggerFactory.getLogger(SSOConfigListener.class.getName());

	/**
	 * @desc 初始化SSO配置信息监听器
	 * @param sce Servlet事件域对象
	 */
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		new SSOConfigurer().initSso(sce.getServletContext());
	}

	/**
	 * @desc 销毁SSO配置信息监听器
	 * @param sce Servlet事件域对象
	 */
	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		logger.info("销毁SSO ");
	}
}